import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Vuex from 'vuex'

Vue.use(Vuex)
// import "./plugins/vant.js";
import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);
import axios from "./plugins/axios.js";
//封装自己的库
import Public from "./plugins/public";

Vue.prototype.$publicObj = Public;

//绑定请求
import * as api from './request/api.js'
Vue.prototype.$api = api;



//公共样式
import "@/assets/css/reset.css"
//引入字体样式
import '@/assets/font/iconfont.css'

import {Lazyload} from 'vant';
Vue.use(Lazyload);

Vue.prototype.$baseUrl = store.state.baseUrl;
Vue.prototype.$base = store.state.baseUrl;

//判断安卓还是ios
let platform = Public.getCookie("platform") || 'web'
//android终端或者uc浏览器
if (platform == 'android') {
  store.state.Models = 'and'
  sessionStorage.setItem(`Models`, 'and');
  if (Public.getCookie('status_bar_height')) {
    // console.log()
    store.state.statusBarHeight = Public.getCookie('status_bar_height') || 0
  };
  window.android.setFullScreen(true) //true 关闭   false开启
} else if (platform == 'ios') {
  store.state.Models = 'ios';

  sessionStorage.setItem(`Models`, 'ios');
  if (Public.getCookie('status_bar_height')) {
    // console.log()
    store.state.statusBarHeight = Public.getCookie('status_bar_height')
  };
} else {
  store.state.Models = 'web'
  sessionStorage.setItem(`Models`, 'web');
}

import extract from "./plugins/extract.js";

// let obj = {
//   city: "吉安",
//   country: "中国",
//   headimgurl: "https://thirdwx.qlogo.cn/mmopen/vi_32/pBmbsoeTVxExibe4WNrGu9YFEjhxOlxqePJfHEsMZLW9iaYQ8DDiat4GIMib8A79zjbdJMAb9dYWfjJSUdIKEEAScg/132",
//   language: "zh_CN",
//   nickname: "酒达",
//   openid: "o_1I2uKswZudFj3eiLxmRO-q5FDg",
//   privilege: [],
//   province: "江西",
//   sex: 1
// }
// let obj={
//   city: "郴州",
//   country: "中国",
//   headimgurl: "https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIEMTyVB5rsUz1UVOw1ZJPpM8gJ7A99D9Fw31ko2Rxib6Y0OZkNzQlRL0fCZqTezkdiaMTmL9OGIKYA/132",
//   language: "zh_CN",
//   nickname: "NULL",
//   openid: "o_1I2uNC1d3xKWIi66nOA6kTFEZI",
//   province: "湖南",
//   sex: 1
// }
let obj = {
  city: "深圳",
  country: "中国",
  headimgurl: "https://thirdwx.qlogo.cn/mmopen/vi_32/CEWufvUZXsX4U4Qib5frc9FopVoEm54wOj4ibXoQ6PnuVlgPic0CanDXvl58ItcCjxydN9GcW3hmjxgqXD7hFZbqw/132",
  language: "zh_CN",
  nickname: "Taurus",
  openid: "o_1I2uNHnWLPwWrabTlOzat5Ah_o",
  province: "广东",
  sex: 1
}
// let obj={
//   country: "阿拉伯联合酋长国",
//   headimgurl: "https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJpewmcagWLPcwKr6bQzkk0X8fApXKdob4ogicCKmGdy0vania1dDh93JRRX0C0oiaWcMmaSTxfyG5dw/132",
//   language: "zh_CN",
//   nickname: "枫小寒",
//   openid: "o_1I2uHlLFc_9SbN7M6_oqtnQ4is",
//   province: "阿布扎比",
//   sex: 1
// }
sessionStorage.setItem("userWxData", JSON.stringify(obj));


// setTimeout(() => {
//   //设置标题
//   sdk.setTitle(store.state.userInfo.companyName);
// }, 800);
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')